/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hujia.bootstrap;

import hujia.domain.User;
import hujia.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/6/14 16:58
 */
@Slf4j
public class Bootstrap {
    public static final String LOG_PATH = "/conf/log4j.properties";

    public static void main(String[] args) {

        String nowPath = System.getProperty("user.dir");
//        Resource resource = new FileSystemResource(nowPath + LOG_PATH);
//        try {
//            PropertyConfigurator.configure(resource.getInputStream());
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("spring-mybatis.xml");
        UserMapper userMapper = applicationContext.getBean("userMapper", UserMapper.class);
        User user = userMapper.selectUserByID(1);
        log.debug(user.getUserName());
        log.debug(nowPath);

    }
}
